package com.general.client.validator;


public abstract class AbstractValidator implements Validator {

	//Pattern pattern;
	String pattern;
	
	@Override
	public void setPattern(String patternStr) {
		//pattern = Pattern.compile(patternStr, Pattern.CASE_INSENSITIVE);
		this.pattern = patternStr;
	}
	
	@Override
	public boolean isValid(String validateStr) {
		if ((pattern != null) && (validateStr != null) && (!validateStr.equals(""))) {
			//return pattern.matcher(validateStr).matches();
			return validateStr.matches(pattern);
		}
		return true;
		
	}
}
